<?php
require_once(dirname(__FILE__)."/../lib/Loader.php");
cload("Smarty.smartyRenderer");
cload("database.dbquery");
cload("requestProcessor");
cload("kinopoisk.kinoPoiskList");

/**
 * Description of kinopoiskList
 *
 * @author Di_Moon
 */
class kinopoiskListPage extends smartyRenderer {
    protected $_dbh;
    protected $_list;
    
    function __construct($dbh) {
        parent::__construct();
        
        $this->_dbh = $dbh;
        $this->_list = new kinoPoiskList($this->_dbh);
        
    }
    
    function render() {
        $kpList = $this->_list->getList();
        $kpTplList = array();
        
        for($i=0; $i<sizeof($kpList); $i++) {
            array_push($kpTplList, $kpList[$i]->getElements());
        }
        
        $this->assign("kpList", $kpTplList);
        
        return $this->fetch("kinopoiskListPage.tpl");
    }
}

?>
